<template>
	<view :class="[primarySize()]">
		<view class="container">
			<view class="ptb20 plr30">
				<view class="item flex-box" @click="logout()">
					<view class="flex-grow-1 col3 fs30">退出登录</view>
					<image src="@/static/public/arrow-r.png" mode="widthFix" class="ico12"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {

			}
		},
		onReady() {
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.primaryColor()
			})
		},
		onLoad() {

		},
		methods: {
			logout() {
				let page = this;
				uni.showModal({
					title: '提示',
					content: '是否确认退出登录',
					success(res) {
						if (res.confirm) {
							uni.removeStorageSync('userinfo' + getApp().globalData.appid);
							uni.$emit(app.globalData.Events.UserLogout,{});
							uni.switchTab({
								url: '/pages/public/index',
							});
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.item {
		width: 690rpx;
		height: 121rpx;
		background: #FFFFFF;
		border-radius: 18rpx;
		padding: 0 30rpx;
	}
</style>